namespace OracleInternal.BinXml
{
	internal class ObxmlInstructionFormat
	{
		internal static readonly short NOOP = 255;

		internal static readonly int HDR_RGUID_LEN = 16;

		internal static readonly byte CSX_MAX_SCHID_LEN = 16;

		internal static readonly byte CSX_MAX_PFX_LEN = 100;

		internal static readonly byte CSX_DEFQNF_ATTR = 1;

		internal static readonly int KIDNUM = 1;

		internal static readonly int TOKENID = 2;

		internal static readonly int TYPDATA = 4;

		internal static readonly int DTDLEN = 8;

		internal static readonly int STANDALONE_SPECIFIED = 1;

		internal static readonly int PROLOG_SPECIFIED = 2;

		internal static readonly int ENCODING_SPECIFIED = 4;

		internal static readonly int VERSION_SPECIFIED = 8;

		internal static readonly int STANDALONE_TRUE = 16;

		internal static readonly int VERSION_MASK = 65280;

		internal static readonly int VERSION_ELEVEN = 4352;

		internal static readonly int ELSTF_SSEQ = 1;

		internal static readonly int ELSTF_NOTDECTYP = 2;

		internal static readonly int ELSTF_IMPTYP = 4;

		internal static readonly int ELSTF_PFXID = 8;

		internal string name;

		internal bool startframe;

		internal bool endframe;

		internal int flags;

		internal bool hasfixeddata;

		internal bool hasvardata;

		internal int opnum;

		internal int[] oplen;

		internal int skiplen;

		internal int fixeddatalen;

		internal static ObxmlInstructionFormat[] InstructionFormats = new ObxmlInstructionFormat[244]
		{
			CreateFormatFixedData("DATSTR1", 1),
			CreateFormatFixedData("DATSTR2", 2),
			CreateFormatFixedData("DATSTR3", 3),
			CreateFormatFixedData("DATSTR4", 4),
			CreateFormatFixedData("DATSTR5", 5),
			CreateFormatFixedData("DATSTR6", 6),
			CreateFormatFixedData("DATSTR7", 7),
			CreateFormatFixedData("DATSTR8", 8),
			CreateFormatFixedData("DATSTR9", 9),
			CreateFormatFixedData("DATSTR10", 10),
			CreateFormatFixedData("DATSTR11", 11),
			CreateFormatFixedData("DATSTR12", 12),
			CreateFormatFixedData("DATSTR13", 13),
			CreateFormatFixedData("DATSTR14", 14),
			CreateFormatFixedData("DATSTR15", 15),
			CreateFormatFixedData("DATSTR16", 16),
			CreateFormatFixedData("DATSTR17", 17),
			CreateFormatFixedData("DATSTR18", 18),
			CreateFormatFixedData("DATSTR19", 19),
			CreateFormatFixedData("DATSTR20", 20),
			CreateFormatFixedData("DATSTR21", 21),
			CreateFormatFixedData("DATSTR22", 22),
			CreateFormatFixedData("DATSTR23", 23),
			CreateFormatFixedData("DATSTR24", 24),
			CreateFormatFixedData("DATSTR25", 25),
			CreateFormatFixedData("DATSTR26", 26),
			CreateFormatFixedData("DATSTR27", 27),
			CreateFormatFixedData("DATSTR28", 28),
			CreateFormatFixedData("DATSTR29", 29),
			CreateFormatFixedData("DATSTR30", 30),
			CreateFormatFixedData("DATSTR31", 31),
			CreateFormatFixedData("DATSTR32", 32),
			CreateFormatFixedData("DATSTR33", 33),
			CreateFormatFixedData("DATSTR34", 34),
			CreateFormatFixedData("DATSTR35", 35),
			CreateFormatFixedData("DATSTR36", 36),
			CreateFormatFixedData("DATSTR37", 37),
			CreateFormatFixedData("DATSTR38", 38),
			CreateFormatFixedData("DATSTR39", 39),
			CreateFormatFixedData("DATSTR40", 40),
			CreateFormatFixedData("DATSTR41", 41),
			CreateFormatFixedData("DATSTR42", 42),
			CreateFormatFixedData("DATSTR43", 43),
			CreateFormatFixedData("DATSTR44", 44),
			CreateFormatFixedData("DATSTR45", 45),
			CreateFormatFixedData("DATSTR46", 46),
			CreateFormatFixedData("DATSTR47", 47),
			CreateFormatFixedData("DATSTR48", 48),
			CreateFormatFixedData("DATSTR49", 49),
			CreateFormatFixedData("DATSTR50", 50),
			CreateFormatFixedData("DATSTR51", 51),
			CreateFormatFixedData("DATSTR52", 52),
			CreateFormatFixedData("DATSTR53", 53),
			CreateFormatFixedData("DATSTR54", 54),
			CreateFormatFixedData("DATSTR55", 55),
			CreateFormatFixedData("DATSTR56", 56),
			CreateFormatFixedData("DATSTR57", 57),
			CreateFormatFixedData("DATSTR58", 58),
			CreateFormatFixedData("DATSTR59", 59),
			CreateFormatFixedData("DATSTR60", 60),
			CreateFormatFixedData("DATSTR61", 61),
			CreateFormatFixedData("DATSTR62", 62),
			CreateFormatFixedData("DATSTR63", 63),
			CreateFormatFixedData("DATSTR64", 64),
			CreateFormatFixedData("DATBIN1", 1),
			CreateFormatFixedData("DATBIN2", 2),
			CreateFormatFixedData("DATBIN3", 3),
			CreateFormatFixedData("DATBIN4", 4),
			CreateFormatFixedData("DATBIN5", 5),
			CreateFormatFixedData("DATBIN6", 6),
			CreateFormatFixedData("DATBIN7", 7),
			CreateFormatFixedData("DATBIN8", 8),
			CreateFormatFixedData("DATBIN9", 9),
			CreateFormatFixedData("DATBIN10", 10),
			CreateFormatFixedData("DATBIN11", 11),
			CreateFormatFixedData("DATBIN12", 12),
			CreateFormatFixedData("DATBIN13", 13),
			CreateFormatFixedData("DATBIN14", 14),
			CreateFormatFixedData("DATBIN15", 15),
			CreateFormatFixedData("DATBIN16", 16),
			CreateFormatFixedData("DATBIN17", 17),
			CreateFormatFixedData("DATBIN18", 18),
			CreateFormatFixedData("DATBIN19", 19),
			CreateFormatFixedData("DATBIN20", 20),
			CreateFormatFixedData("DATBIN21", 21),
			CreateFormatFixedData("DATBIN22", 22),
			CreateFormatFixedData("DATBIN23", 23),
			CreateFormatFixedData("DATBIN24", 24),
			CreateFormatFixedData("DATBIN25", 25),
			CreateFormatFixedData("DATBIN26", 26),
			CreateFormatFixedData("DATBIN27", 27),
			CreateFormatFixedData("DATBIN28", 28),
			CreateFormatFixedData("DATBIN29", 29),
			CreateFormatFixedData("DATBIN30", 30),
			CreateFormatFixedData("DATBIN31", 31),
			CreateFormatFixedData("DATBIN32", 32),
			CreateFormatFixedData("DATNM1", 1),
			CreateFormatFixedData("DATNM2", 2),
			CreateFormatFixedData("DATNM3", 3),
			CreateFormatFixedData("DATNM4", 4),
			CreateFormatFixedData("DATNM5", 5),
			CreateFormatFixedData("DATNM6", 6),
			CreateFormatFixedData("DATNM7", 7),
			CreateFormatFixedData("DATNM8", 8),
			CreateFormatFixedData("DATNM9", 9),
			CreateFormatFixedData("DATNM10", 10),
			CreateFormatFixedData("DATNM11", 11),
			CreateFormatFixedData("DATNM12", 12),
			CreateFormatFixedData("DATNM13", 13),
			CreateFormatFixedData("DATNM14", 14),
			CreateFormatFixedData("DATNM15", 15),
			CreateFormatFixedData("DATNM16", 16),
			CreateFormatFixedData("DATNM17", 17),
			CreateFormatFixedData("DATNM18", 18),
			CreateFormatFixedData("DATNM19", 19),
			CreateFormatFixedData("DATNM20", 20),
			CreateFormatFixedData("DATNM21", 21),
			CreateFormatFixedData("DATINT1", 1),
			CreateFormatFixedData("DATINT2", 2),
			CreateFormatFixedData("DATINT4", 4),
			CreateFormatFixedData("DATINT8", 8),
			CreateFormatFixedData("DATUINT1", 1),
			CreateFormatFixedData("DATUINT2", 2),
			CreateFormatFixedData("DATUINT4", 4),
			CreateFormatFixedData("DATUINT8", 8),
			CreateFormatFixedData("DATFLT4", 4),
			CreateFormatFixedData("DATFLT8", 8),
			CreateFormatFixedData("DATEPH4", 4),
			CreateFormatFixedData("DATEPH8", 8),
			CreateFormatFixedData("DATEPZ6", 4),
			CreateFormatFixedData("DATEPZ10", 8),
			CreateFormatFixedData("DATODT", 7),
			CreateFormatFixedData("DATOTS", 11),
			CreateFormatFixedData("DATOTSZ", 13),
			CreateFormatFixedData("DATBOL", 1),
			CreateFormatFixedData("DATQNM", 7),
			CreateFormatFixedData("DATENM1", 1),
			CreateFormatFixedData("DATENM2", 2),
			CreateFormatEntryF("DATAL2", TYPDATA, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntryF("DATAL8", TYPDATA, hasvardata: true, 1, 8, 0, 0),
			CreateFormatEntryF("DATATL1", TYPDATA, hasvardata: true, 2, 1, 4, 0),
			CreateFormatEntryF("DATATL2", TYPDATA, hasvardata: true, 2, 2, 4, 0),
			CreateFormatEntryF("DATATL8", TYPDATA, hasvardata: true, 2, 8, 4, 0),
			CreateFormatFixedData("DATEMPT", 0),
			CreateFormatEntry("DATNULL", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntrySF("SCHSST1", 0, hasvardata: true, 2, 1, 1, 0),
			CreateFormatEntrySF("SCHSST4", 0, hasvardata: true, 2, 1, 4, 0),
			CreateFormatEntrySF("SCHSST4V", 0, hasvardata: true, 2, 1, 4, 0),
			CreateFormatEntryEF("SCHSEND", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntryF("DTDSTR", DTDLEN, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntryF("DTDELEM", DTDLEN, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntryF("DTDALIST", DTDLEN, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntryF("DTDENT", DTDLEN, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntryF("DTDPENT", DTDLEN, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntryF("DTDNOT", DTDLEN, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntry("DTDEND", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntry("ENTREF", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntry("CHARREF", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntry("DOC", hasvardata: true, 2, 1, 2, 0),
			CreateFormatEntry("STRTSEC", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntry("ENDSEC", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntry("CHUNK", hasvardata: false, 2, 1, 4, 0),
			CreateFormatEntry("REF", hasvardata: true, 1, 1, 0, 0),
			CreateFormatEntry("TEXT1", hasvardata: true, 1, 1, 0, 0),
			CreateFormatEntry("TEXT2", hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntry("TEXT8", hasvardata: true, 1, 8, 0, 0),
			CreateFormatEntry("CDATA1", hasvardata: true, 1, 1, 0, 0),
			CreateFormatEntry("CDATA2", hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntry("CDATA8", hasvardata: true, 1, 8, 0, 0),
			CreateFormatEntry("PI1L1", hasvardata: true, 2, 1, 1, 0),
			CreateFormatEntry("PI2L4", hasvardata: true, 2, 4, 2, 0),
			CreateFormatEntry("CMT1", hasvardata: true, 1, 1, 0, 0),
			CreateFormatEntry("CMT2", hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntry("CMT8", hasvardata: true, 1, 8, 0, 0),
			CreateFormatEntry("DEFNM4L1", hasvardata: true, 2, 1, 4, 0),
			CreateFormatEntry("DEFNM4L2", hasvardata: true, 2, 2, 4, 0),
			CreateFormatEntry("DEFNM8L1", hasvardata: true, 2, 1, 8, 0),
			CreateFormatEntry("DEFNM8L2", hasvardata: true, 2, 2, 8, 0),
			CreateFormatEntry("DEFPFX4", hasvardata: true, 3, 1, 4, 2),
			CreateFormatEntry("DEFPFX8", hasvardata: true, 3, 1, 8, 2),
			CreateFormatEntry4("DEFQ4N4L1", hasvardata: true, 1, 1, 4, 4),
			CreateFormatEntry4("DEFQ4N4L2", hasvardata: true, 2, 1, 4, 4),
			CreateFormatEntry4("DEFQ4N8L1", hasvardata: true, 1, 1, 4, 8),
			CreateFormatEntry4("DEFQ4N8L2", hasvardata: true, 2, 1, 4, 8),
			CreateFormatEntry4("DEFQ8N4L1", hasvardata: true, 1, 1, 8, 4),
			CreateFormatEntry4("DEFQ8N4L2", hasvardata: true, 2, 1, 8, 4),
			CreateFormatEntry4("DEFQ8N8L1", hasvardata: true, 1, 1, 8, 8),
			CreateFormatEntry4("DEFQ8N8L2", hasvardata: true, 2, 1, 8, 8),
			CreateFormatEntryF("PRPK1L1", KIDNUM | TYPDATA, hasvardata: true, 2, 1, 1, 0),
			CreateFormatEntryF("PRPK1L2", KIDNUM | TYPDATA, hasvardata: true, 2, 2, 1, 0),
			CreateFormatEntryF("PRPK2L1", KIDNUM | TYPDATA, hasvardata: true, 2, 1, 2, 0),
			CreateFormatEntryF("PRPK2L2", KIDNUM | TYPDATA, hasvardata: true, 2, 2, 2, 0),
			CreateFormatEntryF("PRPT2L1", TOKENID | TYPDATA, hasvardata: true, 2, 1, 2, 0),
			CreateFormatEntryF("PRPT2L2", TOKENID | TYPDATA, hasvardata: true, 2, 2, 2, 0),
			CreateFormatEntryF("PRPT4L1", TOKENID | TYPDATA, hasvardata: true, 2, 1, 4, 0),
			CreateFormatEntryF("PRPT4L2", TOKENID | TYPDATA, hasvardata: true, 2, 2, 4, 0),
			CreateFormatEntryF("PRPT8L1", TOKENID | TYPDATA, hasvardata: true, 2, 1, 8, 0),
			CreateFormatEntryF("PRPT8L2", TOKENID | TYPDATA, hasvardata: true, 2, 2, 8, 0),
			CreateFormatEntrySF("PRPSTK1", KIDNUM, hasvardata: false, 1, 1, 0, 0),
			CreateFormatEntrySF("PRPSTK2", KIDNUM, hasvardata: false, 1, 2, 0, 0),
			CreateFormatEntrySF("PRPSTT2", TOKENID, hasvardata: false, 1, 2, 0, 0),
			CreateFormatEntrySF("PRPSTT4", TOKENID, hasvardata: false, 1, 4, 0, 0),
			CreateFormatEntrySF("PRPSTT8", TOKENID, hasvardata: false, 1, 8, 0, 0),
			CreateFormatEntrySF("PRPSTK1F", KIDNUM, hasvardata: false, 2, 1, 1, 0),
			CreateFormatEntrySF("PRPSTK2F", KIDNUM, hasvardata: false, 2, 1, 1, 0),
			CreateFormatEntrySF("PRPSTT2F", TOKENID, hasvardata: false, 2, 2, 1, 0),
			CreateFormatEntrySF("PRPSTT4F", TOKENID, hasvardata: false, 2, 4, 1, 0),
			CreateFormatEntrySF("PRPSTT8F", TOKENID, hasvardata: false, 2, 8, 1, 0),
			CreateFormatEntrySF("PRPSTK1V", KIDNUM, hasvardata: true, 3, 1, 1, 1),
			CreateFormatEntrySF("PRPSTK2V", KIDNUM, hasvardata: true, 3, 1, 2, 1),
			CreateFormatEntrySF("PRPSTT2V", TOKENID, hasvardata: true, 3, 1, 2, 1),
			CreateFormatEntrySF("PRPSTT4V", TOKENID, hasvardata: true, 3, 1, 4, 1),
			CreateFormatEntrySF("PRPSTT8V", TOKENID, hasvardata: true, 3, 1, 8, 1),
			CreateFormatEntrySF("ELMSTART", 0, hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntrySF("ELMSTSSEQ", 0, hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntry("ARRBEG", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntry("ARREND", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntryEF("ENDPRP", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntry("NOSEQ", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntry("NOP", hasvardata: false, 0, 0, 0, 0),
			CreateFormatEntry("NOPARR", hasvardata: true, 1, 4, 0, 0),
			CreateFormatEntry("NMSPC", hasvardata: false, 1, 2, 0, 0),
			CreateFormatEntry("NSP4", hasvardata: true, 2, 1, 4, 0),
			CreateFormatEntry("NSP8", hasvardata: true, 2, 1, 8, 0),
			CreateFormatEntrySF("ARRSTK1V", KIDNUM, hasvardata: true, 3, 1, 1, 1),
			CreateFormatEntrySF("ARRSTK2V", KIDNUM, hasvardata: true, 3, 1, 2, 1),
			CreateFormatEntrySF("ARRSTK4V", TOKENID, hasvardata: true, 3, 1, 4, 1),
			CreateFormatEntrySF("ARRSTK8V", TOKENID, hasvardata: true, 3, 1, 8, 1),
			CreateFormatEntryF("PRTDATA", TYPDATA, hasvardata: true, 1, 4, 0, 0),
			CreateFormatEntryF("PRTDATAT", TYPDATA, hasvardata: true, 2, 4, 4, 0),
			CreateFormatEntry("PRTTEXT", hasvardata: true, 1, 4, 0, 0),
			CreateFormatEntry("PRTCDATA", hasvardata: true, 1, 4, 0, 0),
			CreateFormatEntry("PRTPI", hasvardata: true, 2, 4, 2, 0),
			CreateFormatEntry("PRTCMT", hasvardata: true, 1, 4, 0, 0),
			CreateFormatEntry("SPACE1", hasvardata: false, 1, 1, 0, 0),
			CreateFormatEntry("SPACE2", hasvardata: false, 1, 2, 0, 0),
			CreateFormatEntry("SPACE8", hasvardata: false, 1, 8, 0, 0),
			CreateFormatEntry("XMLDECL", hasvardata: true, 1, 1, 0, 0),
			CreateFormatEntry("SPACEQN", hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntry("SPACEQN8", hasvardata: true, 1, 8, 0, 0),
			CreateFormatEntry("ENDPRPSP", hasvardata: true, 1, 1, 0, 0),
			CreateFormatEntry("ENDPRPSP8", hasvardata: true, 1, 8, 0, 0),
			CreateFormatEntry("DTDDECL", hasvardata: true, 1, 1, 0, 0),
			CreateFormatEntry("FORMATEXTENSION", hasvardata: false, 0, 0, 0, 0)
		};

		internal static ObxmlInstructionFormat[] ExtendedInstructionFormats = new ObxmlInstructionFormat[5]
		{
			CreateFormatEntryF("DTDSTRE", DTDLEN, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntryF("DTDNOTE", DTDLEN, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntryF("DTDENTE", DTDLEN, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntryF("DTDPENTE", DTDLEN, hasvardata: true, 1, 2, 0, 0),
			CreateFormatEntryF("DTDALISTE", DTDLEN, hasvardata: true, 1, 2, 0, 0)
		};

		private ObxmlInstructionFormat(string name, bool startframe, bool endframe, int flags, bool hasfixeddata, bool hasvardata, int opnum, int op1len, int op2len, int op3len, int op4len, int fixeddatalen)
		{
			this.name = name;
			this.startframe = startframe;
			this.endframe = endframe;
			this.flags = flags;
			this.hasfixeddata = hasfixeddata;
			this.hasvardata = hasvardata;
			this.opnum = opnum;
			oplen = new int[4];
			oplen[0] = op1len;
			oplen[1] = op2len;
			oplen[2] = op3len;
			oplen[3] = op4len;
			skiplen = (hasvardata ? (op2len + op3len) : (op1len + op2len + op3len));
			this.fixeddatalen = fixeddatalen;
		}

		internal static ObxmlInstructionFormat CreateFormatFixedData(string name, int fixeddatalen)
		{
			return new ObxmlInstructionFormat(name, startframe: false, endframe: false, 0, hasfixeddata: true, hasvardata: false, 0, 0, 0, 0, 0, fixeddatalen);
		}

		internal static ObxmlInstructionFormat CreateFormatEntry(string name, bool hasvardata, int numops, int op1len, int op2len, int op3len)
		{
			return new ObxmlInstructionFormat(name, startframe: false, endframe: false, 0, hasfixeddata: false, hasvardata, numops, op1len, op2len, op3len, 0, 0);
		}

		internal static ObxmlInstructionFormat CreateFormatEntry4(string name, bool hasvardata, int op1len, int op2len, int op3len, int op4len)
		{
			return new ObxmlInstructionFormat(name, startframe: false, endframe: false, 0, hasfixeddata: false, hasvardata, 4, op1len, op2len, op3len, op4len, 0);
		}

		internal static ObxmlInstructionFormat CreateFormatEntryF(string name, int flags, bool hasvardata, int numops, int op1len, int op2len, int op3len)
		{
			return new ObxmlInstructionFormat(name, startframe: false, endframe: false, flags, hasfixeddata: false, hasvardata, numops, op1len, op2len, op3len, 0, 0);
		}

		internal static ObxmlInstructionFormat CreateFormatEntrySF(string name, int flags, bool hasvardata, int numops, int op1len, int op2len, int op3len)
		{
			return new ObxmlInstructionFormat(name, startframe: true, endframe: false, flags, hasfixeddata: false, hasvardata, numops, op1len, op2len, op3len, 0, 0);
		}

		internal static ObxmlInstructionFormat CreateFormatEntryEF(string name, bool hasvardata, int numops, int op1len, int op2len, int op3len)
		{
			return new ObxmlInstructionFormat(name, startframe: false, endframe: true, 0, hasfixeddata: false, hasvardata, numops, op1len, op2len, op3len, 0, 0);
		}
	}
}
